using System.Collections.Generic;
using Microsoft.Data.Schema.ScriptDom.Sql;
//using System.Diagnostics;
using System;
using System.IO;
using System.Text.RegularExpressions;


namespace Neznayka
{
    internal class CheckUniqueConstraintHasNoNullColumnsVisitor : TSqlConcreteFragmentVisitor
    {
        private List<ColumnWithSortOrder> _objects;

        #region ctor
        public CheckUniqueConstraintHasNoNullColumnsVisitor()
        {
            _objects = new List<ColumnWithSortOrder>();
        }
        #endregion

        #region properties
        public List<ColumnWithSortOrder> Objects
        {
            get { return _objects; }
        }
        #endregion

        #region overrides
        public override void ExplicitVisit(UniqueConstraint node)
        {
            // primary key unique constraints by definition have no nullable columns
            if (!node.IsPrimaryKey)
            {
                foreach (var v in node.Columns)
                {
                    _objects.Add(v);
                }
            }
        }

        #endregion

    }


}